package com.example.adminvue.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MainController {

    @RequestMapping("hello")
    @PreAuthorize("hasAuthority('system:main:list')")
    public String hello(){
        return "hello";
    }

    @RequestMapping("test")
    public String test(){
        try {
            Thread.sleep(200);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "test";
    }

    @RequestMapping
    public String index(){
        return "三江后台管理系统接口程序";
    }
}
